package com.naizhuai.ui.actionmodule.presenter;



import com.naizhuai.AppContext;
import com.naizhuai.network.Config;
import com.naizhuai.network.RetrofitServerFactory;
import com.naizhuai.network.apistore.ActionDataRequest;
import com.naizhuai.ui.entity.mainbusiness.SlideContentBean;
import com.naizhuai.util.RxUtils;

import java.util.List;

import rx.Observable;
import rx.schedulers.Schedulers;

/**
 *
 * Created by code_han on 2018/1/25.
 */

public class ActionDataApiStoreIml implements ActionDataApiStore{


    private static ActionDataApiStore INSTANCE=null;

    public static ActionDataApiStore getInstance(){
        if (INSTANCE==null){
            INSTANCE=new ActionDataApiStoreIml();
        }
        return INSTANCE;
    }

    @Override
    public Observable<List<SlideContentBean>> getSlideContentList() {

        return RetrofitServerFactory.create(AppContext.getInstance(), ActionDataRequest.class, Config.TEST_ACTION_BASE_URL)
                .getSlideContentList().subscribeOn(Schedulers.io()).compose(RxUtils.applySchedulers());
    }



}
